package org.example.controller.bank;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.example.common.JsonResult;
import org.example.controller.rep.BankRatePageRep;
import org.example.controller.req.BankRateReq;
import org.example.service.bank.BankRateService;
import org.example.service.utils.IConst;
import org.example.service.utils.PageUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

import java.util.List;

import static org.example.service.utils.IConst.API_BASE;

/**
 * @Author tql
 * @Desc 货币汇率 控制器
 * @Date 2024/2/26 14:36
 * @Version 1.0
 */
@Slf4j
@RestController
@RequestMapping(API_BASE + "bank")
@Api(tags = IConst.MODULE_BANK_RATE)
public class BankRateController {

    @Resource
    private BankRateService bankRateService;

    @GetMapping("/rate/page")
    @ApiOperation(value = "银行汇率分页查询", tags = IConst.MODULE_BANK_RATE)
    public JsonResult<PageUtils<BankRatePageRep>> rate(BankRateReq bankRateReq) {
        return JsonResult.ok(null);
    }

    @GetMapping("/rate/list")
    @ApiOperation(value = "银行汇率列表", tags = IConst.MODULE_BANK_RATE)
    public JsonResult<List<BankRatePageRep>> list() {
        List<BankRatePageRep> lists = bankRateService.hotLists();
        return JsonResult.ok(lists);
    }

    @GetMapping("/all/rate/list")
    @ApiOperation(value = "银行汇率全列表", tags = IConst.MODULE_BANK_RATE)
    public JsonResult<List<BankRatePageRep>> allList() {
        List<BankRatePageRep> lists = bankRateService.lists();
        return JsonResult.ok(lists);
    }


}
